<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stringify&parse</title>
    <script src="../jquery-1.7.2.js"></script>
</head>
<body>
<p>
    <h5>随机的六位验证码</h5>
    <span id="num"></span>
</p>
<script>
    $(function(){
        var num = Math.random().toString().slice(-6);
        $('#num').html(num);
    })
</script>
</body>
</html>